<?php
session_start();
function __autoload($className)
	{
    	require_once('../class/' . $className . '.class.php');
	}
require_once '../header.php';
$post=$_POST;
if($post['do']=="delete")
{
	$ppEmail=$post["paypalEmail"];
	unset($_SESSION["paypal2add"][$ppEmail]);
	echo "1";
}
else if($post['do']=="enterPrice")
{
	$ppEmail=$post["paypalEmail"];
	$price=$post["price"];
	$_SESSION["paypal2add"][$ppEmail]['agent_price']=$price;
	echo "1";
}
else if($post["do"]=="insert")
{
	if(session::is_seller()==TRUE)
	{
		$arrInsert=$_SESSION["paypal2add"];
		foreach($arrInsert as $insert)
		{
			$insert2Db=database::Insert("paypal", $insert);
			if($insert2Db==TRUE)
			{
				echo "Add To Database ".$insert['paypal_email']."<br/>";
			}
			else
			{
				echo "<i><font color=red>Mistake ".$insert['paypal_email']."</font></i><br/>";
			}
		}
	}
}
?>